package com.tianxiabuyi.weixin.qy.message.json;


import com.alibaba.fastjson.annotation.JSONField;
import com.tianxiabuyi.weixin.common.message.Media;
import com.tianxiabuyi.weixin.common.message.MsgType;

/**
 * 文件类消息
 */
public class FileMessage extends JsonMessage {

    @JSONField(name = "file")
    private Media media;

    private boolean safe;

    public FileMessage() {
        this.msgType = MsgType.file;
    }

    public boolean isSafe() {
        return safe;
    }

    public void setSafe(boolean safe) {
        this.safe = safe;
    }

    public Media getMedia() {
        return media;
    }

    public void setMedia(Media media) {
        this.media = media;
    }

    public FileMessage file(String mediaId) {
        this.media = new Media(mediaId);
        return this;
    }

    public FileMessage safe() {
        this.safe = true;
        return this;
    }
}
